<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="Content-Language" content="zh-CN"><link href="stylesheet.css" media="all" rel="stylesheet" type="text/css">
<title>SPI_fname</title>
<script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?d286c55b63a3c54a1e43d10d4c203e75"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script>
</head><body class="REFENTRY">
<div>
<table summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><th colspan="5" align="center" valign="bottom">PostgreSQL 8.2.3 中文文档</th></tr>
<tr><td width="10%" align="left" valign="top"><a href="spi-interface-support.html" accesskey="P">后退</a></td><td width="10%" align="left" valign="top"><a href="spi-interface-support.html#AEN42825">快退</a></td><td width="60%" align="center" valign="bottom"></td><td width="10%" align="right" valign="top"><a href="spi-spi-fnumber.html">快进</a></td><td width="10%" align="right" valign="top"><a href="spi-spi-fnumber.html" accesskey="N">前进</a></td></tr>
</table>
<hr align="LEFT" width="100%"></div>
<h1><a name="SPI-SPI-FNAME"></a>SPI_fname</h1>
<div class="REFNAMEDIV"><a name="AEN42829"></a><h2>函数名</h2>SPI_fname&nbsp;--&nbsp;从指定的字段编号判断字段名字</div>
<a name="AEN42832"></a>
<div class="REFSYNOPSISDIV"><a name="AEN42834"></a><h2>原型</h2>
<pre class="SYNOPSIS">char * SPI_fname(TupleDesc <tt class="PARAMETER">rowdesc</tt>, int <tt class="PARAMETER">colnumber</tt>)</pre>
</div>
<div class="REFSECT1"><a name="AEN42838"></a><h2>描述</h2>
<p><code class="FUNCTION">SPI_fname</code> 返回指定字段的字段名字。你可以在不在需要的时候用 <code class="FUNCTION">pfree</code> 释放这个名字的副本占据的空间。</p>
</div>
<div class="REFSECT1"><a name="AEN42843"></a><h2>参数</h2>
<div class="VARIABLELIST">
<dl>
<dt><tt class="LITERAL">TupleDesc <tt class="PARAMETER">rowdesc</tt></tt></dt>
<dd><p>输入行描述</p></dd>
<dt><tt class="LITERAL">int <tt class="PARAMETER">colnumber</tt></tt></dt>
<dd><p>字段编号(从 1 开始)</p></dd>
</dl>
</div>
</div>
<div class="REFSECT1"><a name="AEN42858"></a><h2>返回值</h2>
<p>字段名；如果 <tt class="PARAMETER">colnumber</tt> 超出范围则返回 <tt class="SYMBOL">NULL</tt> 。错误时，<tt class="VARNAME">SPI_result</tt> 设置为 <tt class="SYMBOL">SPI_ERROR_NOATTRIBUTE</tt></p>
</div>
<div>
<hr align="LEFT" width="100%">
<table summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="33%" align="left" valign="top"><a href="spi-interface-support.html" accesskey="P">后退</a></td><td width="34%" align="center" valign="top"><a href="index.html" accesskey="H">首页</a></td><td width="33%" align="right" valign="top"><a href="spi-spi-fnumber.html" accesskey="N">前进</a></td></tr>
<tr><td width="33%" align="left" valign="top">接口支持函数</td><td width="34%" align="center" valign="top"><a href="spi-interface-support.html" accesskey="U">上一级</a></td><td width="33%" align="right" valign="top">SPI_fnumber</td></tr>
</table>
</div>
</body></html>